/* Downloading wikipages and calls the functions to extract content/links */
/** if this fails to compile, add 'QT+=network' to the .pro **/
#ifndef NETWORK_H
#define NETWORK_H

#include <QtCore>
#include <QtNetwork/QHttp>
#include <QtNetwork/QtNetwork>
#include <QtGui>
#include <QObject>
#include <QtXml>
#include "Nodes.h"
#include "SpideyWindow.h"

class QMessageBox;
class QProgressDialog;
class QDomDocument;
class QGraphicsScene;
class QTime;

class SpideyHttp : public QWidget
{
    Q_OBJECT
public:
    SpideyHttp(SpideyWindow *window, int howDeep);

public slots:
    void downloadWikiPage(const QString & pageName);
    void addToScene(bool error);
//    void updateDataReadProgress(int bytesRead, int totalBytes);

signals:
    void AllDone(bool success);

private:
    void destructo();

    QHttp *http;
//    QProgressDialog *progressDialog;
    QDomDocument *TheDoc;

    SpideyWindow *parentWindow;

    int depthLeft;
};

#endif // NETWORK_H
